home *** CD-ROM | disk | FTP | other *** search
- Public Class DialogBaseForm
- Inherits System.Windows.Forms.Form
-
- #Region " Windows Form Designer generated code "
-
- Public Sub New()
- MyBase.New()
-
- 'This call is required by the Windows Form Designer.
- InitializeComponent()
-
- 'Add any initialization after the InitializeComponent() call
-
- End Sub
-
- 'Form overrides dispose to clean up the component list.
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- Protected WithEvents btnOK As System.Windows.Forms.Button
- Protected WithEvents btnCancel As System.Windows.Forms.Button
- Protected WithEvents txtValue As System.Windows.Forms.TextBox
- Protected WithEvents lblMessage As System.Windows.Forms.Label
- Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.Container
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.btnOK = New System.Windows.Forms.Button()
- Me.txtValue = New System.Windows.Forms.TextBox()
- Me.lblMessage = New System.Windows.Forms.Label()
- Me.PictureBox1 = New System.Windows.Forms.PictureBox()
- Me.btnCancel = New System.Windows.Forms.Button()
- Me.SuspendLayout()
- '
- 'btnOK
- '
- Me.btnOK.Anchor = (System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right)
- Me.btnOK.Location = New System.Drawing.Point(416, 32)
- Me.btnOK.Name = "btnOK"
- Me.btnOK.Size = New System.Drawing.Size(88, 32)
- Me.btnOK.TabIndex = 2
- Me.btnOK.Text = "OK"
- '
- 'txtValue
- '
- Me.txtValue.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
- Or System.Windows.Forms.AnchorStyles.Right)
- Me.txtValue.Location = New System.Drawing.Point(56, 64)
- Me.txtValue.Name = "txtValue"
- Me.txtValue.Size = New System.Drawing.Size(336, 24)
- Me.txtValue.TabIndex = 1
- Me.txtValue.Text = ""
- '
- 'lblMessage
- '
- Me.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
- Or System.Windows.Forms.AnchorStyles.Right)
- Me.lblMessage.Location = New System.Drawing.Point(56, 24)
- Me.lblMessage.Name = "lblMessage"
- Me.lblMessage.Size = New System.Drawing.Size(336, 40)
- Me.lblMessage.TabIndex = 0
- Me.lblMessage.Text = "Type your value here"
- '
- 'PictureBox1
- '
- Me.PictureBox1.BackColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(255, Byte), CType(255, Byte))
- Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
- Me.PictureBox1.Location = New System.Drawing.Point(8, 24)
- Me.PictureBox1.Name = "PictureBox1"
- Me.PictureBox1.Size = New System.Drawing.Size(40, 40)
- Me.PictureBox1.TabIndex = 3
- Me.PictureBox1.TabStop = False
- '
- 'btnCancel
- '
- Me.btnCancel.Anchor = (System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right)
- Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
- Me.btnCancel.Location = New System.Drawing.Point(416, 72)
- Me.btnCancel.Name = "btnCancel"
- Me.btnCancel.Size = New System.Drawing.Size(88, 32)
- Me.btnCancel.TabIndex = 3
- Me.btnCancel.Text = "Cancel"
- '
- 'DialogBaseForm
- '
- Me.AcceptButton = Me.btnOK
- Me.AutoScaleBaseSize = New System.Drawing.Size(7, 17)
- Me.CancelButton = Me.btnCancel
- Me.ClientSize = New System.Drawing.Size(512, 149)
- Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.PictureBox1, Me.txtValue, Me.btnOK, Me.lblMessage, Me.btnCancel})
- Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.Name = "DialogBaseForm"
- Me.Text = "DialogBaseForm"
- Me.ResumeLayout(False)
-
- End Sub
-
- #End Region
-
- ' This is the value typed by the user
- Property InputValue() As String
- Get
- Return txtValue.Text
- End Get
- Set(ByVal Value As String)
- txtValue.Text = Value
- End Set
- End Property
-
- Private Sub btnOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnOK.Click
- OnOkClick()
- End Sub
-
- Private Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCancel.Click
- OnCancelClick()
- End Sub
-
- ' Since this form has been designed for being inherited from
- ' we put the actual Button code in two Protected procedures
- Protected Overridable Sub OnOkClick()
- ' close this form
- Me.DialogResult = DialogResult.OK
- End Sub
-
- Protected Overridable Sub OnCancelClick()
- ' close this form
- Me.DialogResult = DialogResult.Cancel
- End Sub
-
- End Class
-